package indigo.config
{
	import indigo.collections.ArrayList;
	import indigo.collections.IEnumerator;
	import indigo.collections.IList;
	
	public class ListProperty extends CollectionProperty
	{
		public function ListProperty(name:String=null, value:*=null)
		{
			super(name, value);
		}
		
		public override function initialize(initiator:IInitiator):void {
			var items:IList = value;
			var tmp:IList = new ArrayList();
			var e:IEnumerator = items.getEnumerator();
			while(e.moveNext()) {
				if(e.current is ReferenceValue) {
					tmp.add(initiator.factory.getObject(e.current.name));
				} else {
					tmp.add(e.current);
				}
			}
			_value = tmp;
			initiator.visit(this);
		}
	}
}